import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-09-04
 * Time: 21:54
 */



public class Test {
    
    public static void main(String[] args){

        Scanner scan = new Scanner(System.in);
        while(scan.hasNextLine()){
            String s1 = scan.nextLine();
            String s2 = scan.nextLine();
            StringBuilder str1 = new StringBuilder(s1);
            HashSet<Character> set = new HashSet<>();
            char[] str2 = s2.toCharArray();
            for(char c : str2){
                set.add(c);
            }
            for(int i =0;i<str1.length();++i){
                if(set.contains(str1.charAt(i))){
                    str1.deleteCharAt(i);
                }
            }
            //StringBuilder str2 = new StringBuilder(s2);
//            for(int i =0;i<str1.length();++i){
//                for(int j =0;j<str2.length();++j){
//                    if(str1.charAt(i)==str2.charAt(j)){
//                        str1.deleteCharAt(i);
//                        break;
//                    }
//                }
//            }
            System.out.println(str1);
        }
    }

}
